home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 676-700 / 681 / term / source.lha / xproto.h < prev   
C/C++ Source or Header  |  1992-05-09  |  6KB  |  151 lines

  1. /** xproto.h
  2. *
  3. *   Include file for External Protocol Handling
  4. *
  5. **/
  6. /*
  7. *   The structure
  8. */
  9. struct XPR_IO {
  10.                   UBYTE  *xpr_filename;      /* File name(s)             */
  11.                   long (*xpr_fopen)();      /* Open file                */
  12.                   long (*xpr_fclose)();     /* Close file               */
  13.                   long (*xpr_fread)();      /* Get UBYTE from file       */
  14.                   long (*xpr_fwrite)();     /* Put string to file       */
  15.                   long (*xpr_sread)();      /* Get UBYTE from serial     */
  16.                   long (*xpr_swrite)();     /* Put string to serial     */
  17.                   long (*xpr_sflush)();     /* Flush serial input buffer*/
  18.                   long (*xpr_update)();     /* Print stuff              */
  19.                   long (*xpr_chkabort)();   /* Check for abort          */
  20.                   long (*xpr_chkmisc)();    /* Check misc. stuff        */
  21.                   long (*xpr_gets)();       /* Get string interactively */
  22.                   long (*xpr_setserial)();  /* Set and Get serial info  */
  23.                   long (*xpr_ffirst)();     /* Find first file name     */
  24.                   long (*xpr_fnext)();      /* Find next file name      */
  25.                   long (*xpr_finfo)();      /* Return file info         */
  26.                   long (*xpr_fseek)();      /* Seek in a file           */
  27.                   long   xpr_extension;     /* Number of extensions     */
  28.                   long  *xpr_data;          /* Initialized by Setup.    */
  29.                   long (*xpr_options)();    /* Multiple XPR options.    */
  30.                   long (*xpr_unlink)();     /* Delete a file.           */
  31.                   long (*xpr_squery)();     /* Query serial device      */
  32.                   long (*xpr_getptr)();     /* Get various host ptrs    */
  33.               };
  34. /*
  35. *   Number of defined extensions
  36. */
  37. #define XPR_EXTENSION 4L
  38.  
  39. /*
  40. *   The functions
  41. */
  42.  
  43. LONG XProtocolCleanup(struct XPR_IO *);
  44. LONG XProtocolSetup(struct XPR_IO *);
  45. LONG XProtocolSend(struct XPR_IO *);
  46. LONG XProtocolReceive(struct XPR_IO *);
  47. LONG XProtocolHostMon(struct XPR_IO *,APTR,LONG,LONG);
  48. LONG XProtocolUserMon(struct XPR_IO *,APTR,LONG,LONG);
  49.  
  50. #ifdef LATTICE
  51.  
  52. /* Pragmas for SAS/Lattice-C V5.0 */
  53.  
  54. #pragma libcall XProtocolBase XProtocolCleanup 1e 801
  55. #pragma libcall XProtocolBase XProtocolSetup 24 801
  56. #pragma libcall XProtocolBase XProtocolSend 2a 801
  57. #pragma libcall XProtocolBase XProtocolReceive 30 801
  58. #pragma libcall XProtocolBase XProtocolHostMon 36 109804
  59. #pragma libcall XProtocolBase XProtocolUserMon 3c 109804
  60.  
  61. #endif    /* LATTICE */
  62.  
  63. #ifdef AZTEC_C
  64.  
  65. /* Pragmas for Manx Aztec-C V5.0 */
  66.  
  67. #pragma amicall(XProtocolBase, 0x1e, XProtocolCleanup(a0))
  68. #pragma amicall(XProtocolBase, 0x24, XProtocolSetup(a0))
  69. #pragma amicall(XProtocolBase, 0x2a, XProtocolSend(a0))
  70. #pragma amicall(XProtocolBase, 0x30, XProtocolReceive(a0))
  71. #pragma amicall(XProtocolBase, 0x36, XProtocolHostMon(a0,a1,d0,d1))
  72. #pragma amicall(XProtocolBase, 0x3c, XProtocolUserMon(a0,a1,d0,d1))
  73.  
  74. #endif    /* AZTEC */
  75.  
  76. /*
  77. *   Flags returned by XProtocolSetup()
  78. */
  79. #define XPRS_FAILURE    0x00000000L
  80. #define XPRS_SUCCESS    0x00000001L
  81. #define XPRS_NORECREQ   0x00000002L
  82. #define XPRS_NOSNDREQ   0x00000004L
  83. #define XPRS_HOSTMON    0x00000008L
  84. #define XPRS_USERMON    0x00000010L
  85. #define XPRS_HOSTNOWAIT 0x00000020L
  86. /*
  87. *   The update structure
  88. */
  89. struct XPR_UPDATE {     long  xpru_updatemask;
  90.                         UBYTE *xpru_protocol;
  91.                         UBYTE *xpru_filename;
  92.                         long  xpru_filesize;
  93.                         UBYTE *xpru_msg;
  94.                         UBYTE *xpru_errormsg;
  95.                         long  xpru_blocks;
  96.                         long  xpru_blocksize;
  97.                         long  xpru_bytes;
  98.                         long  xpru_errors;
  99.                         long  xpru_timeouts;
  100.                         long  xpru_packettype;
  101.                         long  xpru_packetdelay;
  102.                         long  xpru_chardelay;
  103.                         UBYTE *xpru_blockcheck;
  104.                         UBYTE *xpru_expecttime;
  105.                         UBYTE *xpru_elapsedtime;
  106.                         long  xpru_datarate;
  107.                         long  xpru_reserved1;
  108.                         long  xpru_reserved2;
  109.                         long  xpru_reserved3;
  110.                         long  xpru_reserved4;
  111.                         long  xpru_reserved5;
  112.                    };
  113. /*
  114. *   The possible bit values for the xpru_updatemask are:
  115. */
  116. #define XPRU_PROTOCOL           0x00000001L
  117. #define XPRU_FILENAME           0x00000002L
  118. #define XPRU_FILESIZE           0x00000004L
  119. #define XPRU_MSG                0x00000008L
  120. #define XPRU_ERRORMSG           0x00000010L
  121. #define XPRU_BLOCKS             0x00000020L
  122. #define XPRU_BLOCKSIZE          0x00000040L
  123. #define XPRU_BYTES              0x00000080L
  124. #define XPRU_ERRORS             0x00000100L
  125. #define XPRU_TIMEOUTS           0x00000200L
  126. #define XPRU_PACKETTYPE         0x00000400L
  127. #define XPRU_PACKETDELAY        0x00000800L
  128. #define XPRU_CHARDELAY          0x00001000L
  129. #define XPRU_BLOCKCHECK         0x00002000L
  130. #define XPRU_EXPECTTIME         0x00004000L
  131. #define XPRU_ELAPSEDTIME        0x00008000L
  132. #define XPRU_DATARATE           0x00010000L
  133. /*
  134. *   The xpro_option structure
  135. */
  136. struct xpr_option {
  137.    UBYTE *xpro_description;      /* description of the option                  */
  138.    long  xpro_type;             /* type of option                             */
  139.    UBYTE *xpro_value;            /* pointer to a buffer with the current value */
  140.    long  xpro_length;           /* buffer size                                */
  141. };
  142. /*
  143. *   Valid values for xpro_type are:
  144. */
  145. #define XPRO_BOOLEAN 1L         /* xpro_value is "yes", "no", "on" or "off"   */
  146. #define XPRO_LONG    2L         /* xpro_value is string representing a number */
  147. #define XPRO_STRING  3L         /* xpro_value is a string                     */
  148. #define XPRO_HEADER  4L         /* xpro_value is ignored                      */
  149. #define XPRO_COMMAND 5L         /* xpro_value is ignored                      */
  150. #define XPRO_COMMPAR 6L         /* xpro_value contains command parameters     */
  151.